<style>
    .h1_title{
        font-size:12px;color:#ffffff;line-height:35px;padding-left:15px;
    }
</style>
<div class="maintop">
	当前位置：统计图表
    <a href="javascript:;" action="<?=$basepath?>?<?=$page_url?>" id="btn_refresh" class="mainFrame button">刷新</a>
</div>
<div class="main-search">
    <table width="100%">
        <tbody><tr>
            <td>
                <form action="<?=$basepath?>" id="brandsSearch" method="get" target="ajax" dataType="html" onajax="beforeSearchForm" call="searchForm" container="#iframe" isLoad="true">
                    <select name="field">
                        <option value="uno">玩家号码</option>
                    </select>
                    <input type="text" id="sKey" name="sKey" class="int" placeholder="搜索关键字">
                    &nbsp;日期：从
                    <input id="fromTime" name="fromTime" type="text" class='Wdate' style='width:100px;' value="<?=$searchdata['fromTime']?date('Y-m-d',intval(strtotime($searchdata['fromTime']))):''?>" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',alwaysUseStartDate:true})"></input>&nbsp;至
                    <input id="toTime" name="toTime" type="text" class='Wdate' style='width:100px;' value="<?=$searchdata['toTime']?date('Y-m-d',intval(strtotime($searchdata['toTime']))):''?>" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',alwaysUseStartDate:true})"></input>&nbsp;&nbsp;
                    <input type="submit" value="搜索" class="upbutton">
                </form>
            </td>
            <td>
                统计时间：<?=$datas['countdate']?> 耗时：<?=$datas['consuming']?>ms
            </td>
        </tr>
        </tbody>
    </table>
</div>
<div id="mainbody" class="count-panel hd">
    <h1 class="mu h1_title"><?=$dateTitle?> 统计</h1>
    <table width="100%" class="tablist">
        <thead>
            <tr class="trbg">
                <th>总盈利</th>
                <th>总支付门票</th>
                <th>总支付抽水</th>
                <th>总参与金币</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <? foreach ( $datas['statistics']['all'] as $v ){ ?>
                    <td><?=$v?></td>
                <? } ?>
            </tr>
        </tbody>
    </table>
    <h1 class="h1_title mu" style="margin-top:15px;"><?=$dateTitle?> 游戏汇总</h1>
    <table width="100%" class="tablist">
        <thead>
            <tr class="trbg">
                <th>游戏名称</th>
                <th>盈利</th>
                <th>门票</th>
                <th>抽水</th>
                <th>参与金币</th>
            </tr>
            <tr class="f9">
                <td>五人对战</td>
                <? foreach ( $datas['statistics']['wrdz'] as $v ){ ?>
                    <td><?=$v?></td>
                <? } ?>
            </tr>
            <tr class="f9">
                <td>牛牛</td>
                <? foreach ( $datas['statistics']['nn'] as $v ){ ?>
                    <td><?=$v?></td>
                <? } ?>
            </tr>
            <tr class="f9">
                <td>扫雷</td>
                <? foreach ( $datas['statistics']['sl'] as $v ){ ?>
                    <td><?=$v?></td>
                <? } ?>
            </tr>
            <tr class="f9">
                <td>二八杠</td>
                <? foreach ( $datas['statistics']['ebg'] as $v ){ ?>
                    <td><?=$v?></td>
                <? } ?>
            </tr>
            <tr class="f9">
                <td>十倍牛</td>
                <? foreach ( $datas['statistics']['sbn'] as $v ){ ?>
                    <td><?=$v?></td>
                <? } ?>
            </tr>
        </thead>
    </table>

    <h1 class="h1_title mu" style="margin-top:15px;"><?=$dateTitle?> 充值</h1>
    <table width="100%" class="tablist">
        <thead>
            <tr class="trbg">
                <th>成功充值笔数</th>
                <th>成功充值金额</th>
                <th>成功银行转账</th>
                <th>成功线上支付</th>
                <th>管理员充值</th>
            </tr>
        </thead>
        <tbody>
            <tr class="f9">
                <td><?=$datas['recharge']['count']?>笔/<?=$datas['recharge']['people']?>人</td>
                <td><?=$datas['recharge']['amount']?>元/<?=$datas['recharge']['people']?>人</td>
                <td><?=$datas['recharge']['union_amount']?>元/<?=$datas['recharge']['union_people']?>人</td>
                <td><?=$datas['recharge']['other_amount']?>元/<?=$datas['recharge']['other_people']?>人</td>
                <td><?=$datas['recharge']['admin_amount']?>元/<?=$datas['recharge']['admin_people']?>人</td>
            </tr>
        </tbody>
    </table>

    <h1 class="h1_title mu" style="margin-top:15px;"><?=$dateTitle?> 优惠</h1>
    <table width="100%" class="tablist">
        <thead>
        <tr class="trbg">
            <th>注册赠送</th>
            <th>推荐赠送</th>
            <th>充值赠送</th>
            <th>代理晋级奖励</th>
        </tr>
        </thead>
        <tbody>
        <tr class="f9">
            <td><?=$datas['give']['reg_amount']?></td>
            <td><?=$datas['give']['tj_amount']?></td>
            <td><?=$datas['give']['rec_amount']?></td>
            <td><?=$datas['give']['rise_amount']?></td>
        </tr>
        </tbody>
    </table>

    <h1 class="h1_title mu" style="margin-top:15px;"><?=$dateTitle?> 提现</h1>
    <table width="100%" class="tablist">
        <thead>
        <tr class="trbg">
            <th>提现笔数</th>
            <th>成功提现金额</th>
        </tr>
        </thead>
        <tbody>
        <tr class="f9">
            <td><?=$datas['cash']['count']?>笔/<?=$datas['cash']['people']?>人</td>
            <td><?=$datas['cash']['amount']?>元/<?=$datas['cash']['people']?>人</td>
        </tr>
        </tbody>
    </table>

</div>
<script type="text/javascript">
    function beforeSearchForm(){
        var _key = this.sKey.value;
        if(_key.length<=0){
            //throw '搜索关键字不能为空';
        }
    }
    function searchForm(self, _html, data){
        $("#iframe").html(_html);
    }
    $(document).ready(function(){
        <?php
        if(!empty($searchdata['sKey'])){
            echo '$("#sKey").val("'.$searchdata['sKey'].'");';
        }
        if(!empty($searchdata['fromTime'])){
            echo '$("input[name=fromTime]").val("'.$searchdata['fromTime'].'");';
        }
        if(!empty($searchdata['toTime'])){
            echo '$("input[name=toTime]").val("'.$searchdata['toTime'].'");';
        }
        if(!empty($searchdata['wherefield'])){
            echo '$("select[name=\'wherefield\'] option[value=\''.$searchdata['wherefield'].'\']").attr("selected", "selected");';
        }
        if(!empty($searchdata['field'])){
            echo '$("select[name=\'field\'] option[value=\''.$searchdata['field'].'\']").attr("selected", "selected");';
        }
        ?>
        $(".colorbox").colorbox({ iframe: true,width:"80%",height:"80%" });
    });
</script>

